import React from 'react';
import {View} from 'react-native';
import {DatePicker, List, Provider} from '@ant-design/react-native';
// const now = new Date();
export default class DatePickerPage extends React.Component {
  constructor(props) {
    super(props);
    this.onChange = value => {
      this.setState({value});
    };
    this.state = {
      value: undefined,
    };
  }
  render() {
    return (
      <Provider>
        <View>
          <List>
            <DatePicker
              value={this.state.value}
              mode="date"
              defaultDate={new Date()}
              minDate={new Date(2015, 7, 6)}
              maxDate={new Date(2026, 11, 3)}
              onChange={this.onChange}
              format="YYYY-MM-DD">
              <List.Item arrow="horizontal">Select Date</List.Item>
            </DatePicker>
          </List>
        </View>
      </Provider>
    );
  }
}
